The disclosure relates generally to methods for reallocating memory content from a source memory to a destination memory, and more particularly to methods and apparatus for reallocating memory content between an external memory that is external to an integrated circuit (e.g., chip), and an internal memory located on the chip.
Handheld devices such as smart phones, multimedia players, digital audio players and other handheld devices need to have improved battery life. Low power operation of handheld chips (integrated circuits located within the handheld devices) is essential for long battery life. When these chips initiate an application, such as an audio playback application for example, they try to allocate a memory space for the application within the internal chip-memory structure. If the internal memory structures are already in use by other applications, the chip allocates memory for the new applications memory structures that are external to the chip. However, using external memory increases the power consumption of the handheld device which lowers battery life.
When internal memory on the chip becomes free, current handheld devices are typically unable to move applications from the external memory to internal memory due to the complexity or unreliability of software based migration of memory pages. The device typically therefore continues to use external memory even though internal memory structures are available for use. This can result in an unnecessary consumption of power.
Use of external memory requires external communication pins that may take additional power. If the handheld device enters a low power mode and the application that is executing can reside in internal memory, fewer operations are necessary, but the application normally resides in the external memory. Other systems may allow, for example, all applications that are executing to be moved to internal memory from external memory or maximum number of applications are moved while allowing some minimum number of applications to be executing from external memory. However, these typically employ software synchronization and transfer operations.
In addition, when applications are moved, the operating system stops the application and moves data from external to internal memory. However, the application is stopped so there is an interruption of service for the user which is unacceptable.
One known attempted solution for moving applications between source and destination memory such as an external memory and internal memory, are software based. They typically require complex software synchronization techniques. The software-based transfer operation causes the application to be fully or partially unavailable during the processes of transferring the application. This interruption, no matter how short in duration, would not be acceptable for multi-media applications like audio and video playback.
Known hardware techniques for moving information from external memory to internal memory may include for example a “memory copy engine” or a direct memory access copy engine (DMA engine) that copies data from a source memory to a destination memory are known. The problem with such a copy engine is that any update to a particular location of the source memory that has already been copied to the destination memory will not be reflected in the destination memory. Therefore memory coherence is not enforced.
The application must be stopped while the direct memory access engine is operating so that service is interrupted. In addition, the direct memory access engine is typically not aware of virtual addresses. The software application executing for example, on the host processor tells the direct memory access copy engine to move data. The software application must request translations of virtual to physical memory. Therefore, it is desirable to have a hardware-based system that allows an application to continue running while making a copy or movement of content from source memory to a destination memory.